/* --- --- --- --- --- --- --- --- --- --- --- --- --- --- */
                        系统环境
/* --- --- --- --- --- --- --- --- --- --- --- --- --- --- */

# 1. 查询系统更新：
apt update

# 2. 更新系统依赖：
apt upgrade

/* --- --- --- --- --- --- --- --- --- --- --- --- --- --- */
                        golang开发环境
/* --- --- --- --- --- --- --- --- --- --- --- --- --- --- */

# 1. 官网下载压缩包，并解压到：
tar -zxvf xxxx -C /usr/local/

# 2. 将下面指令添加到 /etc/bash.bashrc 文件末尾，重启指令台：
export GOROOT="/usr/local/go" 
export GOPATH="/home/build/go"
export GOBIN=$GOROOT/bin
export PATH=$PATH:$GOBIN

# 3. 配置代理：
go env -w GO111MODULE=on
go env -w GOPROXY=https://goproxy.io,direct

/* --- --- --- --- --- --- --- --- --- --- --- --- --- --- */
                        vue3开发环境
/* --- --- --- --- --- --- --- --- --- --- --- --- --- --- */

# 1. 下载压缩包：
wget https://nodejs.org/dist/v20.12.0/node-v20.12.0-linux-x64.tar.xz

# 2. 解压到指定目录：
tar -xvf node-v20.12.0-linux-x64.tar.xz -C /usr/local

# 3. 重命名文件夹为 nodejs：
mv -f /usr/local/node-v20.12.0-linux-x64 /usr/local/nodejs

# 4. 将下面指令添加到 /etc/bash.bashrc 文件末尾，重启指令台：
export NODEJSBIN="/usr/local/nodejs/bin"
export PATH=$PATH:$NODEJSBIN

/* --- --- --- --- --- --- --- --- --- --- --- --- --- --- */
                        docker虚拟机
/* --- --- --- --- --- --- --- --- --- --- --- --- --- --- */

# 1. 安装依赖包，以便在APT存储库中使用HTTPS：
apt install -y apt-transport-https ca-certificates curl gnupg lsb-release

# 2. 添加 Docker GPG 密钥：
curl -fsSL https://mirrors.aliyun.com/docker-ce/linux/ubuntu/gpg | sudo gpg --dearmor -o /usr/share/keyrings/docker-archive-keyring.gpg

# 3. 设置Docker存储库：
echo "deb [arch=$(dpkg --print-architecture) signed-by=/usr/share/keyrings/docker-archive-keyring.gpg] https://mirrors.aliyun.com/docker-ce/linux/ubuntu $(lsb_release -cs) stable" | sudo tee /etc/apt/sources.list.d/docker.list > /dev/null

# 4. 更新系统依赖：
apt update

# 5. 安装最新版本的Docker：
apt install -y docker-ce docker-ce-cli containerd.io

# 6. 设置全用户可用：
usermod -aG docker $USER

# 7. 登录私人仓库
sudo docker login --username=aliyun2189670458 crpi-w2z21hxlxxnc5ejz.cn-beijing.personal.cr.aliyuncs.com